package view.component.weapon.light_bow_gun
{
	import feathers.data.ListCollection;
	
	import model.vo.weapon.LightBowGunVo;
	
	import util.ItemUtil;
	import util.WeaponUtil;
	
	import view.component.weapon.BaseBowGunWeaponDetailView;
	
	
	/**
	 * 轻弩-详细信息界面
	 * @author £iang
	 * 
	 */	
	public class LightBowGunDetailView extends BaseBowGunWeaponDetailView
	{
		//-----------------------------
		// variables
		//-----------------------------
		
		//-----------------------------
		// properties
		//-----------------------------
		
		//-----------------------------
		// setter&getter
		//-----------------------------
		
		//-----------------------------
		// methods
		//-----------------------------
		
		/**
		 * 初始化函数 
		 * 
		 */		
		override protected function initialize():void
		{
			super.initialize();
		}
		
		/**
		 * 绘制函数 
		 * 
		 */		
		override protected function draw():void
		{
			super.draw();
			drawPart();
		}
		
		/**
		 * 设置轻弩数据 
		 * @param lightBowGunVo 轻弩数据
		 * 
		 */		
		public function setLightBowGunData( lightBowGunVo:LightBowGunVo ):void
		{
			setBowGunData( lightBowGunVo );
			
			var i:int; 
			var len:int = 0;
			
			if ( lightBowGunVo.specialBullet )
				len = lightBowGunVo.specialBullet.length;
			
			_listDataSpecialBullet = new ListCollection([]);
			
			if ( len == 0 )
			{
				specialBulletLabel.text = "无";
			}
			else
			{
				var itemStr:String = "";
				var tmpIndex:int;
				
				specialBulletLabel.text = "";
				
				for ( i = 0; i < len; i ++ )
				{
					itemStr = "";
					tmpIndex = lightBowGunVo.specialBullet[ i ];
					itemStr += WeaponUtil.getDetialSpecialBulletName( tmpIndex ) + "(";
					itemStr += lightBowGunVo.specialBulletNum[ i ] + ") / ";
					itemStr += WeaponUtil.getQuickShotReactionText( lightBowGunVo.comboShotReaction[ i ] );
					
					if ( _isLimitBreak && lightBowGunVo.specialBulletAddNum )
					{
						itemStr += '<font color="#FF0000"> +' + 
							lightBowGunVo.specialBulletAddNum[ i ] + '　' + '</font>';
					}
					
					_listDataSpecialBullet.push( ItemUtil.mapText2ListObj( itemStr ) );
				}
			}
			
			specialBulletList.dataProvider = _listDataSpecialBullet;
		}
		
		//-----------------------------
		// events
		//-----------------------------
		
		//-----------------------------
		// dispose
		//-----------------------------
		
		/**
		 * 析构函数 
		 * 
		 */		
		override public function dispose():void
		{
			super.dispose();
		}
		
		//-----------------------------
		// construction
		//-----------------------------
		
		/**
		 * 构造函数
		 *
		 */
		public function LightBowGunDetailView()
		{
			super();
			weaponType = "light_bow_gun";
			insertOffset = 0;
			_addAttackTitleText = "长桶+：";
			_specialBulletTitleText = "速射：(红字：限制解除后增加的装填数)";
			_addAttackPriceTitleText = "   长桶：";
			_otherPriceTitleText = "消音器：";
		}
	}
}